package com.ruoyi.dmpdolphinscheduler.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dmpdolphinscheduler.mapper.DmpDolphinschedulerConfigMapper;
import com.ruoyi.dmpdolphinscheduler.domain.DmpDolphinschedulerConfig;
import com.ruoyi.dmpdolphinscheduler.service.IDmpDolphinschedulerConfigService;

/**
 * DS调度系统配置Service业务层处理
 * 
 * @author MquanZeng
 * @date 2021-12-31
 */
@Service
public class DmpDolphinschedulerConfigServiceImpl implements IDmpDolphinschedulerConfigService 
{
    @Autowired
    private DmpDolphinschedulerConfigMapper dmpDolphinschedulerConfigMapper;

    /**
     * 查询DS调度系统配置
     * 
     * @param dolsId DS调度系统配置主键
     * @return DS调度系统配置
     */
    @Override
    public DmpDolphinschedulerConfig selectDmpDolphinschedulerConfigByDolsId(Long dolsId)
    {
        return dmpDolphinschedulerConfigMapper.selectDmpDolphinschedulerConfigByDolsId(dolsId);
    }

    /**
     * 查询DS调度系统配置列表
     * 
     * @param dmpDolphinschedulerConfig DS调度系统配置
     * @return DS调度系统配置
     */
    @Override
    public List<DmpDolphinschedulerConfig> selectDmpDolphinschedulerConfigList(DmpDolphinschedulerConfig dmpDolphinschedulerConfig)
    {
        return dmpDolphinschedulerConfigMapper.selectDmpDolphinschedulerConfigList(dmpDolphinschedulerConfig);
    }

    /**
     * 新增DS调度系统配置
     * 
     * @param dmpDolphinschedulerConfig DS调度系统配置
     * @return 结果
     */
    @Override
    public int insertDmpDolphinschedulerConfig(DmpDolphinschedulerConfig dmpDolphinschedulerConfig)
    {
        dmpDolphinschedulerConfig.setCreateTime(DateUtils.getNowDate());
        return dmpDolphinschedulerConfigMapper.insertDmpDolphinschedulerConfig(dmpDolphinschedulerConfig);
    }

    /**
     * 修改DS调度系统配置
     * 
     * @param dmpDolphinschedulerConfig DS调度系统配置
     * @return 结果
     */
    @Override
    public int updateDmpDolphinschedulerConfig(DmpDolphinschedulerConfig dmpDolphinschedulerConfig)
    {
        dmpDolphinschedulerConfig.setUpdateTime(DateUtils.getNowDate());
        return dmpDolphinschedulerConfigMapper.updateDmpDolphinschedulerConfig(dmpDolphinschedulerConfig);
    }

    /**
     * 批量删除DS调度系统配置
     * 
     * @param dolsIds 需要删除的DS调度系统配置主键
     * @return 结果
     */
    @Override
    public int deleteDmpDolphinschedulerConfigByDolsIds(Long[] dolsIds)
    {
        return dmpDolphinschedulerConfigMapper.deleteDmpDolphinschedulerConfigByDolsIds(dolsIds);
    }

    /**
     * 删除DS调度系统配置信息
     * 
     * @param dolsId DS调度系统配置主键
     * @return 结果
     */
    @Override
    public int deleteDmpDolphinschedulerConfigByDolsId(Long dolsId)
    {
        return dmpDolphinschedulerConfigMapper.deleteDmpDolphinschedulerConfigByDolsId(dolsId);
    }


    /**
     * 获取调度系统下拉项
     *
     * @return 结果
     */
    @Override
    public List<DmpDolphinschedulerConfig> getDolSdrOptions() {
        return dmpDolphinschedulerConfigMapper.selectDolSdrOptionsList();
    }
}
